﻿using System.Collections.Specialized;
using System.Web;
using System.Web.Mvc;

namespace MvcTestingHelpers {
	/// <summary>
	/// HttpRequest implementation that is safe for MVC
	/// </summary>
	public class FakeHttpRequest : HttpRequestBase {
		private readonly HttpVerbs httpMethod;

		/// <param name="httpMethod">The HTTP request method</param>
		public FakeHttpRequest(HttpVerbs httpMethod) {
			this.httpMethod = httpMethod;
		}

		public override string HttpMethod { get { return httpMethod.ToString(); } }
		public override NameValueCollection Form { get { return new NameValueCollection(); } }
		public override NameValueCollection Headers { get { return new NameValueCollection(); } }
		public override NameValueCollection QueryString { get { return new NameValueCollection(); } }
		public override string RawUrl { get { return "http://example.com/"; } }

		public override void ValidateInput() { }
	}
}